UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZPzlMa4IdYJX5/iwyINZzuy6CcXAxHXOQBDmG5kEWqc=' 
WHERE 
  key_id = '9119ab4981da0e5a7fcee9ff0b465873462b9e55f74dbd0ee584b573e16e81cd' 
  AND (
    token = 'ZPzlMa4IdYJX5/iwyINZzuy6CcXAxHXOQBDmG5kEWqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035