UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FBKe9pmiVeV1XVdtr3XvuCxDZtvSj+5LMSYTA0V/XXA='
WHERE
key_id = 'f1024d87608c33755e2215f0e9197fbbd3a29ab81c68ff1ffa0d6a9ef92bdc07'
AND (
token = 'FBKe9pmiVeV1XVdtr3XvuCxDZtvSj+5LMSYTA0V/XXA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)