UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KBiUyQ4UWHazlkbpDdhG6DVwD7mY3ZFWI2aTGpOLsy0='
WHERE
key_id = '26f250d32addfaf04857ce9e99bdf9a92a753a99a51d9ddf3b146be3dd319da7'
AND (
token = 'KBiUyQ4UWHazlkbpDdhG6DVwD7mY3ZFWI2aTGpOLsy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)