UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'izukEVlKiUSr9CX7MJnMa7HWy8Yy2GlUe6jtDSAhCfM=' 
WHERE 
  key_id = '3d7efc368cdf7577d5c4fde7cde6d400a9637976e7be8ac12eee6395b3ff596e' 
  AND (
    token = 'izukEVlKiUSr9CX7MJnMa7HWy8Yy2GlUe6jtDSAhCfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021