UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JniA4SUpMmBIZbSorjhwpk6OYZwuTF9Z5CvtenrNFac='
WHERE
key_id = '0b1a9e8780f4676f906db27505e0065044dd1d739be88357e58becfd3d0c66ea'
AND (
token = 'JniA4SUpMmBIZbSorjhwpk6OYZwuTF9Z5CvtenrNFac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)