UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jfigBEkQYFioUwAs/vqxUEyDTilTri7QyZC/NFdmzyI='
WHERE
key_id = '045a7940014d625515dd43531fb15110a57cf1bcba4e79021be541089291cd25'
AND (
token = 'jfigBEkQYFioUwAs/vqxUEyDTilTri7QyZC/NFdmzyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)