UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hFTndByN8pqQnKv01WzKgvoN9IqQeqOrFmkv33bvppA=' 
WHERE 
  key_id = '33d74cebea2c47cbbbf73aa2698e2329c618a909ab4d789cd6f104c459a6a416' 
  AND (
    token = 'hFTndByN8pqQnKv01WzKgvoN9IqQeqOrFmkv33bvppA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062