UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '79GrCWKRlMc/0QTThBB5OPj7sk7STSDTerQnf5qcfCg=' 
WHERE 
  key_id = '05122f0bdbff45763d3576fa3dc469a7e310c0d50930034487c0a0fcd3ae9570' 
  AND (
    token = '79GrCWKRlMc/0QTThBB5OPj7sk7STSDTerQnf5qcfCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046