UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'orKchoQATnZPFSIuCJrs/CUuM2maw3pgAoUKn45sCSA=' 
WHERE 
  key_id = 'db1b533ee6cc8f77cd4c4c88494e2483b596ad09a5c3fdaf4365d674b2896ec9' 
  AND (
    token = 'orKchoQATnZPFSIuCJrs/CUuM2maw3pgAoUKn45sCSA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026