UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W5J69m4vCHI+XQ904zPfwOAxnLTow4CuV1J3qqGjvdE='
WHERE
key_id = 'd750a5cf62f8eaa2d72ee7ab0a5f9c7ee31e5d1101ebf50cdd92ab61c44dc23f'
AND (
token = 'W5J69m4vCHI+XQ904zPfwOAxnLTow4CuV1J3qqGjvdE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)