UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PYLH78Qb8MBg7c5QkUglhhjB+0Be0E57Bvj5RFlg0B8=' 
WHERE 
  key_id = '97478f61ec0b94b9c4c4506b113789ad4f3faa609e3db5a64f11163683a43e3e' 
  AND (
    token = 'PYLH78Qb8MBg7c5QkUglhhjB+0Be0E57Bvj5RFlg0B8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031