UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AE/f4CA49VIj+XZn99znA5P4OQ7ISkPDfRD+KQCJm7c=' 
WHERE 
  key_id = 'e548a25bfb53277ff8c02eefe2eeb8923e65a431bb7ffcf1d9cbfdd6964e8d22' 
  AND (
    token = 'AE/f4CA49VIj+XZn99znA5P4OQ7ISkPDfRD+KQCJm7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037