UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GDgLVOXOA8lrBrhb7wMd79lBBww2eMqM3DFSYOff1Pw='
WHERE
key_id = '25762061042abe6a902dd200bbcd90cf6aa6de39670b9a9483275046e7300d4c'
AND (
token = 'GDgLVOXOA8lrBrhb7wMd79lBBww2eMqM3DFSYOff1Pw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)