UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1WmWHO9oPs1nVzoX2WePIU9vh/0rbB3eEfwgoXwMkCk=' 
WHERE 
  key_id = '253ab8c5b34330fafbd72014815e3f39a7d7e739d98346d63ef22e78ea552135' 
  AND (
    token = '1WmWHO9oPs1nVzoX2WePIU9vh/0rbB3eEfwgoXwMkCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059