UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'agXVIf08hfMTJqtlZPZ+/qfbF+HovCGMTvJfWIEK7PA=' 
WHERE 
  key_id = '55e5b28bddd81b7756aa6d40276aab4d4076391cfdd86b8040d2d2480681e29d' 
  AND (
    token = 'agXVIf08hfMTJqtlZPZ+/qfbF+HovCGMTvJfWIEK7PA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041