UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JOF0AQNPYYrvO+o/a6RkDIi/1IsGxjFaMjhz3h9Fnl4=' 
WHERE 
  key_id = '449979bd49adb9dcd2d217193f8de6433577ac05219c7a821508050d95f5673c' 
  AND (
    token = 'JOF0AQNPYYrvO+o/a6RkDIi/1IsGxjFaMjhz3h9Fnl4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021