UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pv7JwP6UXLfoY3QFwX+riPS9CZQABhFnIHSr+341i7g=' 
WHERE 
  key_id = '6c79f6a192035795a1dbc0bf88d696ac92f9288edb09b212bb00e5d231f9b318' 
  AND (
    token = 'Pv7JwP6UXLfoY3QFwX+riPS9CZQABhFnIHSr+341i7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024