UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MkWlPLl0Q8X4HwyYI4k7fIEXjtO0YSfrzIa91NQJkqw=' 
WHERE 
  key_id = '094922f3d721930a4b126d0f357ff48588bf3ef3fa51768ed30d29d2ce5cf8ad' 
  AND (
    token = 'MkWlPLl0Q8X4HwyYI4k7fIEXjtO0YSfrzIa91NQJkqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046