UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JDyFW4Cnlun2+OOal0bv0ghp82csEQ65sIoU8ragXsc='
WHERE
key_id = '5b61d21cf00334ffa6f08c3965b2f03a4a1a634c77ae0f17d5311868d9381d6f'
AND (
token = 'JDyFW4Cnlun2+OOal0bv0ghp82csEQ65sIoU8ragXsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)