UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2EiicBCpdAkoUO3LSrNsx1r2tMd+gtbNOXBMW0FuWPQ='
WHERE
key_id = 'c1fd339f1561d428d17fe78baf0e7a0afecc80cc3f3e211c7709deb08befa0f3'
AND (
token = '2EiicBCpdAkoUO3LSrNsx1r2tMd+gtbNOXBMW0FuWPQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)