UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rblc1rbHDXPnPLD0nNyEI9UlAWUb1oX6+/zPPMcdjb8='
WHERE
key_id = 'b052b076b49877fd612671df61dddb11e1fdbee6c619e6b9666ca365a9816940'
AND (
token = 'rblc1rbHDXPnPLD0nNyEI9UlAWUb1oX6+/zPPMcdjb8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)