UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V5CrhreJ+w58H9BPWtzK4ume603WR8gxkF+m53mxN8w=' 
WHERE 
  key_id = '903ed6048a65d00dbbd49599a96ec07a87947bc6f9d431582c026a0e68fb9275' 
  AND (
    token = 'V5CrhreJ+w58H9BPWtzK4ume603WR8gxkF+m53mxN8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027