UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c5qQVELq3NXMGK6yGoHJxRlwN5Ckq+LU9gJa0Py+HvQ=' 
WHERE 
  key_id = '1af9b4faa5ea0352b6697bb2a73adca9ddbcc57185627ae8260db9209dcbc8e8' 
  AND (
    token = 'c5qQVELq3NXMGK6yGoHJxRlwN5Ckq+LU9gJa0Py+HvQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033