UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K949+tie9knDGbu3nGcCIim5sZhQ0GJCoBM7Sw9w0I8='
WHERE
key_id = '3e4c1fcb1eeeb6374cd50094ba2c6e306ae0d796754806d83ee313724fc4729d'
AND (
token = 'K949+tie9knDGbu3nGcCIim5sZhQ0GJCoBM7Sw9w0I8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)