UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ChlJOC0u/LPT+WkKbPNv2nnEDla3kDyyvAYxujVmpyM='
WHERE
key_id = '5f024a0b55c9ee0218622b7fbe73e9e6ef8c17ae2e9e592b08930feb95341373'
AND (
token = 'ChlJOC0u/LPT+WkKbPNv2nnEDla3kDyyvAYxujVmpyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)