UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 300, 
  token = 'VYYNN64M3ZEQV/gS/ZNSh/VL+wGQmslJ2llSSOV62gs=' 
WHERE 
  key_id = 'e7ac3c6c5d7832c54d06a460bc4d6988d2cb712b2a787de5c033d1ee5f7836be' 
  AND (
    token = 'VYYNN64M3ZEQV/gS/ZNSh/VL+wGQmslJ2llSSOV62gs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050