UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ykqnRx43dt19EHapWiJGXvGSplhLK10IrBD2+LeqXyI='
WHERE
key_id = '087dceac37f3d164b35afa1eb07e9602eb9e87f7a327037979fb0d82c73c35d7'
AND (
token = 'ykqnRx43dt19EHapWiJGXvGSplhLK10IrBD2+LeqXyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)