UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bR9NGXM3tDO1PC3NUR63kryA89X1eNj2bYr+CqFp33w='
WHERE
key_id = 'de3dd45fa1d500cc9cf71a7e1d83ef618edf4d66e78396ce2fb877d5843a2603'
AND (
token = 'bR9NGXM3tDO1PC3NUR63kryA89X1eNj2bYr+CqFp33w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)