UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LnXEbNCiCCWVTTGud7GpZ2T+3VOvZOP8ocDxkn5l3nM='
WHERE
key_id = '8d0e0e4f3422dcd63677d0673280a22f13653aba423cf5ba009577406777d843'
AND (
token = 'LnXEbNCiCCWVTTGud7GpZ2T+3VOvZOP8ocDxkn5l3nM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)