UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yEAnQd6TO/PgITYmlxaWMEUahyRyLOkfbS3E3wKEBTw='
WHERE
key_id = '573e309e94de2849b5dcbea8aead3a3ca25aa9303620a7b950373407e27b0f5f'
AND (
token = 'yEAnQd6TO/PgITYmlxaWMEUahyRyLOkfbS3E3wKEBTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)