UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'it/LIzmichfxNmoNDPzTHZBCW9+5x8hpiV1R0OCVSa8=' 
WHERE 
  key_id = 'e73a1927a0ca87cc9b5b2564c5da0dd51466e2744c456938c7972f359404d83f' 
  AND (
    token = 'it/LIzmichfxNmoNDPzTHZBCW9+5x8hpiV1R0OCVSa8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030