UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V2QRFF0Di8r8dV/j61G1cIP6dObcC4RUUqKFrX6ZQ8U='
WHERE
key_id = '61daeefbc21f0d7abe1453e73b23b1362f01c33c64c395d63c45101b16f30030'
AND (
token = 'V2QRFF0Di8r8dV/j61G1cIP6dObcC4RUUqKFrX6ZQ8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)