UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7OxJp4EGH1hHi743XCmkjgRrZ6OTglWMvTyM9yg2MaA='
WHERE
key_id = 'd5521c60aa828ab027191bff131ef27c775a195835496cc02be25c986725b381'
AND (
token = '7OxJp4EGH1hHi743XCmkjgRrZ6OTglWMvTyM9yg2MaA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)