UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'twqS+CUjHd1Az5hF8yN5FrGEY041WaZJxMQgutbJFVw=' 
WHERE 
  key_id = 'e9f12956cb011fd6a2b8ebbefd5c65c5104bd747673698baca28ade5562272c2' 
  AND (
    token = 'twqS+CUjHd1Az5hF8yN5FrGEY041WaZJxMQgutbJFVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025