UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mq0XfLyw1LcJiR08r9cajKWnMXR7rHqehqB9uPTDkSs=' 
WHERE 
  key_id = 'e3d150e57424f1940a0ce7d31c2683b0f6a3444c91400fb4642bb75abba5a1b4' 
  AND (
    token = 'Mq0XfLyw1LcJiR08r9cajKWnMXR7rHqehqB9uPTDkSs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033