UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o9mqFtCOyGjz+qLbvMulrpwxob3jH/03zjTlwbr60m4=' 
WHERE 
  key_id = 'c5829770486f3f9dc176817a018b231aa6b0a890d59a0c5d36dab36f361463eb' 
  AND (
    token = 'o9mqFtCOyGjz+qLbvMulrpwxob3jH/03zjTlwbr60m4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033