UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3kH0lMN/6iyvIiswjMqXQiUumyPHbePRnst4VZWeB/U='
WHERE
key_id = 'c14227358a6f875ed154f7fcfb53ca911f50dbcdde9413badff3a751ed5c47f2'
AND (
token = '3kH0lMN/6iyvIiswjMqXQiUumyPHbePRnst4VZWeB/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)