UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fwuavi/9q1+FWmvScAgXgCR2KqyzZ/0c/zIIuiX9RmQ=' 
WHERE 
  key_id = '9d11ab273951ff365c8adbf27a65de7b19e40ce22b023fb8c4d2254fa91a252d' 
  AND (
    token = 'fwuavi/9q1+FWmvScAgXgCR2KqyzZ/0c/zIIuiX9RmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028