UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VrTu5zSz/qg9driTMX0DSIGhjMq2ACLvPGeBnOZ/xHA=' 
WHERE 
  key_id = 'e48f8d3297fb64ec260f6c6e1ddaf33c005fb70e90a9b4856133cd6d706d23a2' 
  AND (
    token = 'VrTu5zSz/qg9driTMX0DSIGhjMq2ACLvPGeBnOZ/xHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023