UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kST7UMbrMYbh7iADYSM5UAGeKk9/dIVZ2pLri0CtKgg='
WHERE
key_id = 'a667a027c808cad5f4f34a89b583e516d0068bc5c265ed47f779557084112597'
AND (
token = 'kST7UMbrMYbh7iADYSM5UAGeKk9/dIVZ2pLri0CtKgg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)