UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M/FUDfsGphWJ0CkLB7g18I0WWwYlGfg7j19iCLPkt3w=' 
WHERE 
  key_id = '0bf87af87c8d14f2c60c1cae3a4b5ead24d0d1c201114666aeb07a0e45a2097d' 
  AND (
    token = 'M/FUDfsGphWJ0CkLB7g18I0WWwYlGfg7j19iCLPkt3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031