UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+fVCEpns9nZNCKbBFXzVkm3hf3Fw+FqvQ5zVZUzmAb0='
WHERE
key_id = '5cb2415f95a191fb35e1cad2f9fcb0ce46662246bf752e5c0759553f44104ae0'
AND (
token = '+fVCEpns9nZNCKbBFXzVkm3hf3Fw+FqvQ5zVZUzmAb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)